<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript输入对话框</title>
</head>
<body>

<p>点击按钮查看输入的对话框。</p>
<button onclick="myFunction()">点我</button>
<p id = "dome"></p>
<script>
    function myFunction() {
        var x;
        var person = prompt("请输入你的名字！");
        if(person!=null&&person!="") {
            x = "你好 " + person + "! 今天感觉如何?" ;
            document.getElementById("dome").innerHTML = x;
        }
    }
</script>
</body>
</html>